from django.db import models


class Manufacturers(models.Model):
    """
    制造商
    """
    code = models.CharField(max_length=255, verbose_name='code')
    name = models.CharField(max_length=255, verbose_name='name')
    description = models.CharField(max_length=255, null=True, blank=True, verbose_name='description')
    create_datetime = models.DateTimeField(auto_now_add=True, verbose_name="创建时间")
    update_datetime = models.DateTimeField(auto_now=True, verbose_name="更新时间")

    objects = models.Manager()

    def __str__(self):
        return self.name

    class Meta:
        db_table = 'manufacturers'
        verbose_name = '制造商'
        verbose_name_plural = verbose_name
        ordering = ['code']
